import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
/*
 *  参考：  java.lang
 *
    public interface Comparable<T>
         int compareTo(T o);
    }

 */
class Goods implements Comparable<Goods>{
    String style;
    String id;
    String name;
    double price;

    Goods(String style,String id,String name,double price){
        this.style = style;
        this.id = id;
        this.name = name;
        this.price = price;
    }

    public int compareTo(Goods other) {
        int result = this.style.compareTo(other.style);
        if (result != 0) {
            return result;
        }
        return Double.compare(this.price, other.price);
    }

    public String toString(){
        return style+"--"+id+"--"+name+"--"+price;
    }
}

public class Main4{
    public static void main(String[] args) {
        List<Goods> goodsList = new ArrayList<Goods>();
        Scanner sc = new Scanner(System.in);
        for(int i=0;i<10;i++) {
            String style = sc.next();
            String id = sc.next();
            String name = sc.next();
            double price = sc.nextDouble();
            goodsList.add(new Goods(style,id,name,price));
        }
        Collections.sort(goodsList);
        for(Goods g:goodsList) {
            System.out.println(g);
        }
        sc.close();
    }
}


